#ifndef MAINWINDOW_H
#define MAINWINDOW_H

# pragma execution_character_set("utf-8")

#include <QMainWindow>
#include "qmqtt.h"
#include "g29_work_thread.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
public slots:
    void log(QString text);
    void pushButton_cb();
    void mqtt_client_connected_cb();
    void mqtt_client_disconnected_cb();
    void mqtt_client_error_cb(QMQTT::ClientError error);
    void mqtt_client_subscribed_cb(QString topic,quint8 qos);
    void mqtt_client_unsubscribed_cb(QString topic);
    void mqtt_client_published_cb(QMQTT::Message message,quint16 msgid);
    void mqtt_client_pingresp_cb();
    void mqtt_client_recevied_cb(QMQTT::Message message);
    void g29_data_refresh(QString p0,QString p1,QString p2,QString p3);
    void g29_data_publish();
signals:
    void g29_init();
    void g29_destroy();
protected:
private:
    Ui::MainWindow *ui;
    QMQTT::Client* m_mqtt_client = NULL;
    G29_Work_Thread* m_g29_work_thread = NULL;
};
#endif // MAINWINDOW_H
